package com.itheima;

//账户实体类,作用创建账户对象,封装账户对象
/*
 *ATM系统的存储账户存储结构
 *  每一个账户是一个对象,只负责对对数据的存储
 *  业务的操作会放到ATM中进行
 *
 * */
public class Account {
    private String cardId;//卡号
    private String userName;//账号
    private char sex; //性别
    private String passWord; //密码
    private double money;//余额
    private double limit;//取款限制
//实体类:无参构造器必须有
    //构造器
//一般不提供有参构造器,因为在开发中数据过多,不可能一次性全部注入进去,这也是为什么必须javabean必须加无参构造器的原因
    //一般都是用户录一个set一个
    public Account() {
    }

    public Account(String cardId, String userName, char sex, String passWord, double money, double limit) {
        this.cardId = cardId;
        this.userName = userName;
        this.sex = sex;
        this.passWord = passWord;
        this.money = money;
        this.limit = limit;
    }

    //合理暴露

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public double getLimit() {
        return limit;
    }

    public void setLimit(double limit) {
        this.limit = limit;
    }

    //对性别进行封装,后面很多地方都会用到性别
    public String getUserInfo(){
        return userName + "" + (sex == '男'? "精神小伙" : "女");
    }



}
